import { UserStatus, UserRole } from '@/types/user';

export const USER_STATUS_OPTIONS: { label: string; value: UserStatus; color: string }[] = [
  { label: '激活', value: 'active', color: 'green' },
  { label: '未激活', value: 'inactive', color: 'orange' },
  { label: '已禁用', value: 'suspended', color: 'red' },
];

export const USER_ROLE_OPTIONS: { label: string; value: UserRole; color: string }[] = [
  { label: '管理员', value: 'admin', color: 'red' },
  { label: '经理', value: 'manager', color: 'blue' },
  { label: '用户', value: 'user', color: 'green' },
  { label: '访客', value: 'guest', color: 'gray' },
];

export const DEPARTMENT_OPTIONS = [
  'IT部门', '产品部门', '技术部门', '设计部门', '质量部门', 
  '销售部门', '市场部门', '人事部门', '财务部门', '其他'
];

export const getStatusLabel = (status: UserStatus): string => {
  return USER_STATUS_OPTIONS.find(option => option.value === status)?.label || status;
};

export const getStatusColor = (status: UserStatus): string => {
  return USER_STATUS_OPTIONS.find(option => option.value === status)?.color || 'default';
};

export const getRoleLabel = (role: UserRole): string => {
  return USER_ROLE_OPTIONS.find(option => option.value === role)?.label || role;
};

export const getRoleColor = (role: UserRole): string => {
  return USER_ROLE_OPTIONS.find(option => option.value === role)?.color || 'default';
}; 